//Created By Gaurav Shrestha

report = new com.openbravo.pos.reports.PanelReportBean();

report.setTitleKey("Menu.timeClockDetailTitle");
report.setReport("/com/openbravo/reports/employeeTimeCard");
report.setResourceBundle("com/openbravo/reports/employeeTimeCard_messages");

//report.setSentence("SELECT PEOPLE.NAME, MIN(RECEIPTS.DATENEW) AS STARTDATE, MAX(RECEIPTS.DATENEW) AS ENDDATE, SUM(TICKETLINES.UNITS * TICKETLINES.PRICE) AS TOTAL " +
//                "FROM PEOPLE, RECEIPTS, TICKETS, TICKETLINES WHERE PEOPLE.ID = TICKETS.PERSON AND RECEIPTS.ID = TICKETS.ID AND TICKETS.ID = TICKETLINES.TICKET AND ?(QBF_FILTER) " +
//                "GROUP BY PEOPLE.NAME ORDER BY PEOPLE.NAME");

report.setSentence("SELECT PEOPLE.NAME, CLOCKINOUT.ClockedInTime as STARTDATE, CLOCKINOUT.ClockedOutTime as ENDDATE, TIME_TO_SEC(TIMEDIFF(CLOCKINOUT.ClockedOutTime,CLOCKINOUT.ClockedInTime))/3600 as TOTAL FROM PEOPLE, CLOCKINOUT "+ 
                    "WHERE CLOCKINOUT.EmployeeID = PEOPLE.ID AND ?(QBF_FILTER) ORDER BY NAME");

report.addParameter("CLOCKINOUT.ClockedInTime");
report.addParameter("CLOCKINOUT.ClockedOutTime");
report.addQBFFilter(new com.openbravo.pos.reports.JParamsDatesInterval());

report.addField("NAME", com.openbravo.data.loader.Datas.STRING);
report.addField("STARTDATE", com.openbravo.data.loader.Datas.TIMESTAMP);
report.addField("ENDDATE", com.openbravo.data.loader.Datas.TIMESTAMP);
report.addField("TOTAL", com.openbravo.data.loader.Datas.STRING);


report;

